<?php

namespace App\Admin\Renderable;

use App\Models\Database;
use App\Models\MessageTemplate;
use Dcat\Admin\Admin;
use Dcat\Admin\Grid;
use Dcat\Admin\Grid\LazyRenderable;
use Illuminate\Contracts\Support\Renderable;

class MessageTemplateTable extends LazyRenderable
{
    /**选项卡和栏目一的数据
     * @inheritDoc
     */
    public function grid(): Grid
    {
        return Grid::make(new MessageTemplate(), function (Grid $grid) {
            //  $grid->disableActions();
            $grid->column('id', 'ID');
            $grid->column('template_name', '模板名称');
            $grid->column('template_content', '模板内容');
            $grid->paginate(10);
            $grid->disableActions();
            // $grid->selector(function (Grid\Tools\Selector $selector) {
            //     $selector->select('pid', '分类', [1 => 'PPT', 2 => 'DA', 3 => 'newsletter', 4 => '一图读懂', 5 => '思维导图', 6 => '短视频', 7 => '直播链接', 34 => '原文']);
            // });
        });
    }
}
